package org.robert.export_client.excel.metadata;

import org.robert.export_client.aop.ExcelDepend;

/**
 * DependEntity:
 *
 * @author zhaoshengtao
 * @date 2024/01/31
 */
public class DependEntity {

    /**
     * 依赖字段
     */
    private String dependField;

    /**
     * 依赖类型 大于 小于 大于等于 小于等于 不等于 等于 包含 不包含
     * 枚举类中寻找
     */
    private ComparisonEnum dependType;

    /**
     * 依赖值，如果是区间，则依赖最大值
     */
    private String dependValue;

    /**
     * 如果是区间，则依赖最小值
     */
    private String dependMinValue;

    /**
     * dependValue、dependMinValue 的类型class,比如 Integer.class 、String.class
     */
    private Class<?> valueClazz;

    /**
     * 是否固定值
     */
    private boolean isFixed;

    private String fixedValue;

    public DependEntity(ExcelDepend excelDepend){
        this.dependField = excelDepend.name();
        this.dependType = excelDepend.type();
        this.dependValue = excelDepend.value();
        this.dependMinValue = excelDepend.minValue();
        this.valueClazz = excelDepend.valueType();
        this.isFixed = excelDepend.isFixed();
        this.fixedValue = excelDepend.fixedValue();
    }

    public boolean isFixed() {
        return isFixed;
    }

    public void setFixed(boolean fixed) {
        isFixed = fixed;
    }

    public String getDependField() {
        return dependField;
    }

    public void setDependField(String dependField) {
        this.dependField = dependField;
    }

    public ComparisonEnum getDependType() {
        return dependType;
    }

    public void setDependType(ComparisonEnum dependType) {
        this.dependType = dependType;
    }

    public String getDependValue() {
        return dependValue;
    }

    public void setDependValue(String dependValue) {
        this.dependValue = dependValue;
    }

    public String getDependMinValue() {
        return dependMinValue;
    }

    public void setDependMinValue(String dependMinValue) {
        this.dependMinValue = dependMinValue;
    }

    public Class<?> getValueClazz() {
        return valueClazz;
    }

    public void setValueClazz(Class<?> valueClazz) {
        this.valueClazz = valueClazz;
    }

    public String getFixedValue() {
        return fixedValue;
    }

    public void setFixedValue(String fixedValue) {
        this.fixedValue = fixedValue;
    }
}
